@RunWith(SpringRunner.class)
@SpringBootTest
public class UserServiceTest {
    @Autowired
    private UserService userService;

    @MockBean
    private UserDao userDao;

    @Test
    public void testCreateUser() {
        User user = new User();
        user.setName("John");
        user.setEmail("john@example.com");

        when(userDao.save(user)).thenReturn(user);

        User createdUser = userService.createUser(user);
        assertEquals(user, createdUser);
    }
}